# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-mss
pkgname=('python2-mss' 'python-mss')
_pkgname=mss
pkgver=10.0.0
pkgrel=1
pkgdesc='An ultra fast cross-platform multiple screenshots module in pure python using ctypes.'
url='https://pypi.org/project/mss/#files'
arch=('any')
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f2ed2fcd927e51a90facd3f7eefa56e745ed5ccb04fcf46f66f3ad969dc2d5f28d87887950cdd1f552e36250376e4cd77d6c65607848f7768e952319c6197bdc')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-mss() {
  depends=('python2' 'python2-argparse')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

package_python-mss() {
  depends=('python' 'python-argparse')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

